package com.itheima.eurekaprovider.controller;

import com.itheima.eurekaprovider.pojo.Customer;
import com.itheima.eurekaprovider.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @GetMapping("findAll")
    public List<Customer> findAll() {
        List<Customer> customerList = customerService.findAll();
        return customerList;
    }

}
